const express = require('express')
const router = express()

const handler = require('../router_handler/majors')

// 导入验证数据的中间件
const expressJoi = require('@escook/express-joi')
// 导入文章分类的验证模块
const { 
    update_major_schema,
    add_major_schema,
    delete_major_schema
 } = require('../schema/majorcate')

// 获取专业信息
router.get('/', handler.getMajorInfo)

// 修改专业信息
router.post('/update', expressJoi(update_major_schema), handler.updateMajorInfo)

// 新增
router.post('/add', expressJoi(add_major_schema), handler.addMajor)

// 删除
router.get('/delete/:id', expressJoi(delete_major_schema), handler.deleteMajor)


module.exports = router;